/*
 *  CELabelAtlas.h
 *  RedWeed
 *
 *  Created by Vasili Svirski on 05/11/12.
 *  Copyright 2011 League of Independent Developers. All rights reserved.
 *
 */


#ifndef __CELABEL_ATLAS_H__
#define __CELABEL_ATLAS_H__

#include "cocos2dx_extentions/labels/CELabelProtocol.h"

#include "lid_lib/src/types/LLTypes.h"

#include "cocos2d.h"

namespace cocosext {


////////////////////////////////////////////////////////
//
/** CELabelAtlas
 */
//////////////////////////////////////////////////////// 


class  CELabelAtlas : public cocos2d::CCLabelAtlas, public CELabelProtocol 
{
protected:
	std::wstring _mString;
    wchar_t _mMapStartChar;


public:
	CELabelAtlas():_mMapStartChar(0) {;}
    virtual ~CELabelAtlas() {;}

    static CELabelAtlas * labelWithString(const wchar_t *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, wchar_t startCharMap);

public:
	bool initWithString(const wchar_t *label, const char *charMapFile, unsigned int itemWidth, unsigned int itemHeight, wchar_t startCharMap);
	
// super methods    
    virtual void updateAtlasValues();

// CELabelProtocol
        /** sets a new label using an string */
    void setString(const wchar_t *label);
        /** returns the string that is rendered */
    const wchar_t* getString(void) const { return _mString.c_str(); }
};

} // end namespace cocosext

#endif //__CELABEL_ATLAS_H__
